﻿using Microsoft.Xna.Framework;

namespace TrinityEngine.UI
{
    public class Button : Component
    {
        public Action onClick;

        protected override void Update()
        {
            Rectangle rect = new Rectangle(0, 0, Screen.width, Screen.height);
            /*if (!rect.Contains(Input.mousePosition))
            {
                return;
            }

            if (Input.GetMouseButtonDown(0) && (transform as RectTransform).rect.Contains(Input.mousePosition))
            {
                onClick?.Invoke();
            }*/
        }

        protected override void OnDestroy()
        {
            onClick = null;
        }
    }
}
